<%--
 * action-1.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>

<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="bids" requestURI="${requestURI}" id="row">


	<spring:message code="bid.customer" var="customerHeader" />
	<display:column property="customer.name" title="${customerHeader}"
		sortable="false" />

	<spring:message code="bid.creationMoment" var="creationMomentHeader" />
	<display:column property="date"
		title="${creationMomentHeader}" sortable="false"
		format="{0,date,dd/MM/yyyy HH:mm}" />

	<spring:message code="bid.amount" var="amountHeader" />
	<display:column property="amount" title="${amountHeader}"
		sortable="false" />


		
	
	<jstl:if test="${isWinner}">
		<jstl:if test="${idWinningBid==row.id}">
			<spring:message code="bid.yes" var="aux" />
		</jstl:if>
		
		<spring:message code="bid.winner" var="winnerHeader" />
		<display:column value="${aux }" title="${winnerHeader}"
				sortable="false" />
		<jstl:if test="${aux=='YES'}">
			<spring:message code="bid.void" var="aux" />
		</jstl:if>
	
			
		



	</jstl:if>

	<jstl:if test="${!isWinner && finishedAuction}">
		<security:authorize access="hasRole('CUSTOMER')">
			<display:column>
				<acme:cancel code="bid.selectWinner"
					url="bid/customer/winner.do?bidId=${row.id}" />
			</display:column>

		</security:authorize>
	</jstl:if>
</display:table>



<acme:cancel code="bid.goBack" url="${backURI}" />


